//
//  HTWaybillStateHeadCell.m
//  TruckDriver
//
//  Created by Ting Han on 2017/9/29.
//  Copyright © 2017年 Ting Han. All rights reserved.
//

#import "HTWaybillStateHeadCell.h"

@interface HTWaybillStateHeadCell()
    @property (weak, nonatomic) IBOutlet UILabel *stateLabel;
    @property (weak, nonatomic) IBOutlet UILabel *startLabel;
    @property (weak, nonatomic) IBOutlet UILabel *secondLabel;
    @property (weak, nonatomic) IBOutlet UILabel *threeLabel;
    @property (weak, nonatomic) IBOutlet UILabel *fourLabel;
    @property (weak, nonatomic) IBOutlet UIImageView *startImageView;
    @property (weak, nonatomic) IBOutlet UIImageView *fourImageView;
   
    @property (weak, nonatomic) IBOutlet UIImageView *secondImageView;
    @property (weak, nonatomic) IBOutlet UIImageView *threeImageView;
    
    @property (weak, nonatomic) IBOutlet UIView *lineOne;
     @property (weak, nonatomic) IBOutlet UIView *lineTwo;
    @property (weak, nonatomic) IBOutlet UIView *lineThree;
@property (weak, nonatomic) IBOutlet UIView *hiddenView;

    @end


@implementation HTWaybillStateHeadCell

- (void)setWaybillStateType:(HTWaybillStateType)waybillStateType{
    _waybillStateType = waybillStateType;
    switch (waybillStateType) {
        case HTWaybillStateTypeFirst:
        {
            self.stateLabel.text = @"已接单";
            self.startImageView.image = [UIImage imageNamed:@"icon-circles-select"];
            self.secondImageView.image = [UIImage imageNamed:@"icon-circles-noselect"];
            self.threeImageView.image = [UIImage imageNamed:@"icon-circles-noselect"];
            self.fourImageView.image = [UIImage imageNamed:@"icon-circles-noselect"];
            self.lineOne.backgroundColor = [UIColor lightGrayColor];
            self.lineTwo.backgroundColor = [UIColor lightGrayColor];
            self.lineThree.backgroundColor = [UIColor lightGrayColor];
            
        }
            break;
        case HTWaybillStateTypeSecond:
        {
            self.stateLabel.text = @"运输中";
            self.startImageView.image = [UIImage imageNamed:@"icon-circles-select"];
            self.secondImageView.image = [UIImage imageNamed:@"icon-circles-select"];
            self.threeImageView.image = [UIImage imageNamed:@"icon-circles-noselect"];
            self.fourImageView.image = [UIImage imageNamed:@"icon-circles-noselect"];
            self.lineOne.backgroundColor = kBlueColor;
            self.lineTwo.backgroundColor = [UIColor lightGrayColor];
            self.lineThree.backgroundColor = [UIColor lightGrayColor];
        }
            break;
        case HTWaybillStateTypeThird:
        {
            self.stateLabel.text = @"待评价";
            self.startImageView.image = [UIImage imageNamed:@"icon-circles-select"];
            self.secondImageView.image = [UIImage imageNamed:@"icon-circles-select"];
            self.threeImageView.image = [UIImage imageNamed:@"icon-circles-select"];
            self.fourImageView.image = [UIImage imageNamed:@"icon-circles-noselect"];
            self.lineOne.backgroundColor = kBlueColor;
            self.lineTwo.backgroundColor = kBlueColor;
            self.lineThree.backgroundColor = [UIColor lightGrayColor];
        }
            break;
        case HTWaybillStateTypeForth:
        {
            self.stateLabel.text = @"已完成";
            self.startImageView.image = [UIImage imageNamed:@"icon-circles-select"];
            self.secondImageView.image = [UIImage imageNamed:@"icon-circles-select"];
            self.threeImageView.image = [UIImage imageNamed:@"icon-circles-select"];
            self.fourImageView.image = [UIImage imageNamed:@"icon-circles-select"];
            self.lineOne.backgroundColor = kBlueColor;
            self.lineTwo.backgroundColor = kBlueColor;
            self.lineThree.backgroundColor = kBlueColor;
        }
            break;
        case HTWaybillStateTypeFifth:
        {
            self.stateLabel.text = @"已取消";
            self.hiddenView.hidden  = YES;
            
        }
            break;
            
        default:
            break;
    }
}

- (void)awakeFromNib {
    [super awakeFromNib];
   
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

}

@end
